package GUI.Cliente.Exceptions;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Label;

public class ErrorEnBusqueda extends Dialog {

	protected Object result;
	protected Shell shell;
	String mensaje;

	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public ErrorEnBusqueda(Shell parent, int style, String m) {
		super(parent, style);
		setText("Error en la Busqueda");
		mensaje=m;
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), getStyle());
		shell.setSize(450, 300);
		shell.setText(getText());
		shell.setLayout(new FormLayout());
		
		Label lblNewLabel = new Label(shell, SWT.NONE);
		lblNewLabel.setAlignment(SWT.CENTER);
		FormData fd_lblNewLabel = new FormData();
		fd_lblNewLabel.top = new FormAttachment(0, 114);
		fd_lblNewLabel.left = new FormAttachment(0, 81);
		fd_lblNewLabel.bottom = new FormAttachment(0, 163);
		fd_lblNewLabel.right = new FormAttachment(0, 368);
		lblNewLabel.setLayoutData(fd_lblNewLabel);
		lblNewLabel.setText("New Label");

	}
}
